﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Mdsd.Cpoe.BusinessComponent;
using Microsoft.Practices.Unity.Configuration;

namespace Mdsd.Cpoe.Host
{
    class Program
    {
        static void Main(string[] args)
        {

            OpenService(typeof(FoundationService));
            OpenService(typeof(CommonService));
            Console.ReadLine();
        }
        static void OpenService(Type type)
        {
            var host = new ServiceHost(type);
            host.Opening += new EventHandler(host_Opening);

            host.Open();
            Console.WriteLine(type.FullName + "已启动============");

        }
        static void host_Opening(object sender, EventArgs e)
        {
            var host = sender as ServiceHost;
            
            Console.WriteLine(host.Description);
        }
    }
}
